<?php
namespace app\index\controller;

use think\Request;

//关系
class Relation extends Common{
	
	//进货关系、进货下级
	public function jhxj(){
		$req = Request::instance();
		$pm = [
			'agentid' => AGENT_ID,
		];
		$res = \ServerHelper::post('relation_jhxj',$pm);
		$data = $this->J($res);
		
		return view('',$data['data']);
	}
	
	//进货关系、进货上级
	public function jhsj(){
		$req = Request::instance();
		$pm = [
			'agentid' => AGENT_ID,
		];
		$res = \ServerHelper::post('relation_jhsj',$pm);
		$data = $this->J($res);
		
		return view('',$data['data']);
	}
	
	//进货关系详情(下级)
	public function jhxj_d(){
		$req = Request::instance();
		$pm = [
			'agentid' => AGENT_ID,
			'toagentid' => $req->param('toagentid'),
			'dtype' => 3
		];
		$res = \ServerHelper::post('relation_jhxq',$pm);
		$data = $this->J($res);
		return view('',$data['data']);
	}
	
	//
	public function jhsj_d(){
		$req = Request::instance();
		$pm = [
			'agentid' => AGENT_ID,
			'toagentid' => $req->param('toagentid'),
			'dtype' => 4
		];
		$res = \ServerHelper::post('relation_jhxq',$pm);
		$data = $this->J($res);
		return view('',$data['data']);
	}
	
	//邀请关系、我邀请的
	public function wyqd(){
		$req = Request::instance();
		$pm = [
			'agentid' => AGENT_ID,
		];
		$res = \ServerHelper::post('relation_wyqd',$pm);
		$data = $this->J($res);
		return view('',$data['data']);
	}
	//我邀请的详细
	public function wyqd_d(){
		$req = Request::instance();
		$pm = [
			'agentid' => AGENT_ID,
			'toagentid' => $req->param('toagentid'),
			'dtype' => 1
		];
		$res = \ServerHelper::post('relation_yq_detail',$pm);
		$data = $this->J($res);
		return view('',$data['data']);
	}
	//邀请关系、邀请我的
	public function yqwd(){
		$req = Request::instance();
		$pm = [
			'agentid' => AGENT_ID,
		];
		$res = \ServerHelper::post('relation_yqwd',$pm);
		$data = $this->J($res);
		return view('',$data['data']);

	}
	/*
1我邀请的
2邀请我的
3进货下级
4进货上级


	*/
	//邀请我的详细
	public function yqwd_d(){
		$req = Request::instance();
		$pm = [
			'agentid' => AGENT_ID,
			'toagentid' => $req->param('toagentid'),
			'dtype' => 2
		];
		$res = \ServerHelper::post('relation_yq_detail',$pm);
		$data = $this->J($res);
		return view('',$data['data']);
	}


	
}
